/*
 * The Open Source Unix Installer
 *
 * The MIT License
 *
 * Copyright 2011-2012 Andrey Pudov.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

/*
 * @author  Andrey Pudov    <andrey@andreypudov.com>
 * @version 0.00.00
 * @name    u_main.c
 * @date:   Jab 27, 2012
 */

#include <stdio.h>
#include <stdlib.h>

#include "init.h"

#include "u_crc16.h"
#include "u_crc32.h"
#include "u_crc64.h"
#include "u_dictionary.h"
#include "u_logger.h"
#include "u_processor.h"
#include "u_properties.h"
#include "u_shell.h"
#include "u_system.h"
#include "u_xml_attribute.h"
#include "u_xml_document.h"
#include "u_xml_element.h"
#include "u_xml_example.h"
#include "u_xml_reader.h"

int main(int argc, char **argv) {
    printf("The Open Source Unix Installer Testing Package\n");
    printf("Copyright (C) 2011-2013 Andrey Pudov.\n");
    printf("All rights reserved.\n\n");
    
    /* initialize the core */
    installer_init_init(argc, argv); 
    
    if (u_installer_crypt_crc16_start()
            && u_installer_crypt_crc32_start()
            && u_installer_crypt_crc64_start()
            && u_installer_dictionary_start()
            && u_installer_logger_start()
         /* && u_installer_processor_start() */
            && u_installer_properties_start()
            && u_installer_shell_start()
            && u_installer_system_start()
            && u_installer_xml_attribute_start()
            && u_installer_xml_document_start()
            && u_installer_xml_element_start()
         /* && u_installer_xml_example_start() */
            && u_installer_xml_reader_start()
            ) {
        printf("\n\033[0;32mTEST BUILD SUCCESS\033[0;37m\n");
    } else {
        printf("\n\033[0;31mTEST BUILD FAILED\033[0;37m\n");
    }

    return (EXIT_SUCCESS);
}
